<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var date=new Date()
        console.log(date)
        //get方法 获取
        console.log(date.getFullYear())
        console.log(date.getMonth()+1)
        console.log(date.getDate())
        console.log(date.getHours())
        console.log(date.getMinutes())
        console.log(date.getSeconds())
        //set方法 设置
        date.setFullYear(2000)
        date.setMonth(11)
        date.setDate(8)
        console.log(date.getFullYear())
        console.log(date.getMonth()+1)
        console.log(date.getDate())
    </script>
</head>
<body>
    
</body>
</html>